{include file="include/top"}
<body>
<div class="x-nav">
            <span class="layui-breadcrumb">
              <a><cite>首页</cite></a>
              <a><cite>系统管理</cite></a>
              <a><cite>系统设置</cite></a>
            </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right"  href="javascript:location.replace(location.href);" title="刷新"><i class="layui-icon" style="line-height:30px">ဂ</i></a>
</div>
<div class="x-body">
    <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
        <ul class="layui-tab-title">
            <li class="layui-this">网站设置</li>
            <li>利益设置</li>
        </ul>
        <div class="layui-tab-content" >

            <!--        基本设置           -->
            <div class="layui-tab-item layui-show">
                <form class="layui-form layui-form-pane" action="javascript:;" id="myform1">
                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class='x-red'>*</span>网站名称
                        </label>
                        <div class="layui-input-block">
                            <input type="text" name="Title" autocomplete="off" placeholder="控制在25个字、50个字节以内"
                                   class="layui-input" value="{$Title}">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class='x-red'>*</span>网站状态
                        </label>
                        <div class="layui-input-block" style="line-height: 30px;font-size: 14px;">
                            <label style="margin-left: 20px;"><input id="State" type="radio"  name="State" value="1" style="display: inherit;" {if $State == 1} checked {/if}>&nbsp;开启 </label>
                            <label style="margin-left: 20px;"><input id="State2" type="radio" name="State" value="0" style="display: inherit;" {if $State == 0} checked {/if}>&nbsp;关闭 </label>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class='x-red'>*</span>系统通知
                        </label>
                        <div class="layui-input-block">
                            <input type="text" name="XiZhi" autocomplete="off" placeholder="控制在25个字、50个字节以内"
                                   class="layui-input" value="{$XiZhi}">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class='x-red'>*</span>版权信息
                        </label>
                        <div class="layui-input-block">
                            <input type="text" name="Ban" autocomplete="off" placeholder="&copy; 2020 guiguo"
                                   class="layui-input" value="{$Ban}">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class='x-red'>*</span>备案号
                        </label>
                        <div class="layui-input-block">
                            <input type="text" name="Bei" autocomplete="off" placeholder="鲁ICP备00000000号"
                                   class="layui-input" value="{$Bei}">
                        </div>
                    </div>
                    <label for="username" class="layui-form-label">
                        <span class="x-red">*</span>前台Logo
                    </label>
                    <div class="layui-input-inline">
                        <div class="layui-upload">
                            <button type="button" class="layui-btn" id="test1">上传图片</button>
                            <input type="hidden" name="headImg" id="headImg">
                            <div class="layui-upload-list">
                                <img class="layui-upload-img" src="{$Logo}" id="demo1" width="200">
                                <p id="demoText"></p>
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item layui-form-text">
                        <label class="layui-form-label">
                            <span class='x-red'>*</span>关闭原因
                        </label>
                        <div class="layui-input-block">
                            <textarea placeholder="网站为啥要关闭呢" name="Nodesc" class="layui-textarea">{$Nodesc}</textarea>
                        </div>
                    </div>
                    <div class="layui-form-item layui-form-text">
                        <label class="layui-form-label">
                            <span class='x-red'>*</span>统计代码
                        </label>
                        <div class="layui-input-block">
                            <textarea placeholder="请输入内容" name="Daima" class="layui-textarea">{$Daima}</textarea>
                        </div>
                    </div>
                    <input type="hidden" name="type" value="1">
                    <div class="layui-form-item">
                        <button class="layui-btn" lay-submit="" lay-filter="*" onclick="sub('1')">
                            保存
                        </button>
                    </div>
                </form>
                <div style="height:100px;"></div>
            </div>

            <!--        利益设置           -->
            <div class="layui-tab-item">
                <form class="layui-form layui-form-pane" action="javascript:;" id="myform3">
                    <div class="layui-form-item">
                        <label class="layui-form-label" style="width:150px;">
                            <span class='x-red'>*</span>1U等于多少蔬菜积分
                        </label>
                        <div class="layui-input-block" style="display: flex;">
                            <input type="text" name="Poins" autocomplete="off" placeholder="1U等于多少蔬菜积分"
                                   class="layui-input" value="{$Poins}" style="width:50px;">
                            <label class="layui-form-label" style="width:60px;">
                                ￥
                            </label>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label" style="width:150px;">
                            <span class='x-red'>*</span>静态收益比例
                        </label>
                        <div class="layui-input-block" style="display: flex;">
                            <input type="number" name="static" autocomplete="off" placeholder="控制在25个字、50个字节以内"
                                   class="layui-input" value="{$static}" style="width:50px;">
                            <label class="layui-form-label" style="width:60px;">
                                %
                            </label>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label" style="width:150px;">
                            <span class='x-red'>*</span>报单所需USDT
                        </label>
                        <div class="layui-input-block" style="display: flex;">
                            <input type="text" name="Mci" autocomplete="off" placeholder="报单所需USDT"
                                   class="layui-input" value="{$Mci}" style="width:50px;">
                            <label class="layui-form-label" style="width:60px;">
                                U
                            </label>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label" style="width:150px;">
                            <span class='x-red'>*</span>下级报单上级所得奖励比
                        </label>
                        <div class="layui-input-block" style="display: flex;">
                            <input type="number" name="share" autocomplete="off" placeholder="控制在25个字、50个字节以内"
                                   class="layui-input" value="{$share}" style="width:50px;">
                            <label class="layui-form-label" style="width:60px;">
                                %
                            </label>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label" style="width:150px;">
                            <span class='x-red'>*</span>止损重生第1期返回波比
                        </label>
                        <div class="layui-input-block" style="display: flex;">
                            <input type="number" name="reborn_one" autocomplete="off" placeholder="控制在25个字、50个字节以内"
                                   class="layui-input" value="{$reborn_one}" style="width:50px;">
                            <label class="layui-form-label" style="width:60px;">
                                %
                            </label>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label" style="width:150px;">
                            <span class='x-red'>*</span>止损重生第2期返回波比
                        </label>
                        <div class="layui-input-block" style="display: flex;">
                            <input type="number" name="reborn_two" autocomplete="off" placeholder="控制在25个字、50个字节以内"
                                   class="layui-input" value="{$reborn_two}" style="width:50px;">
                            <label class="layui-form-label" style="width:60px;">
                                %
                            </label>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label" style="width:150px;">
                            <span class='x-red'>*</span>止损重生第3期返回波比
                        </label>
                        <div class="layui-input-block" style="display: flex;">
                            <input type="number" name="reborn_three" autocomplete="off" placeholder="控制在25个字、50个字节以内"
                                   class="layui-input" value="{$reborn_three}" style="width:50px;">
                            <label class="layui-form-label" style="width:60px;">
                                %
                            </label>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label" style="width:150px;">
                            <span class='x-red'>*</span>止损重生第4期返回波比
                        </label>
                        <div class="layui-input-block" style="display: flex;">
                            <input type="number" name="reborn_four" autocomplete="off" placeholder="控制在25个字、50个字节以内"
                                   class="layui-input" value="{$reborn_four}" style="width:50px;">
                            <label class="layui-form-label" style="width:60px;">
                                %
                            </label>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label" style="width:150px;">
                            <span class='x-red'>*</span>提币矿工费率
                        </label>
                        <div class="layui-input-block" style="display: flex;">
                            <input type="number" name="Kfei" autocomplete="off" placeholder="控制在25个字、50个字节以内"
                                   class="layui-input" value="{$Kfei}" style="width:50px;">
                            <label class="layui-form-label" style="width:60px;">
                                %
                            </label>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label" style="width:150px;">
                            <span class='x-red'>*</span>平台收款钱包地址
                        </label>
                        <div class="layui-input-block">
                            <input type="text" name="Worig" autocomplete="off" placeholder="直接输入加密地址即可"
                                   class="layui-input" value="{$Worig}" style="width:80px;">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label for="username" class="layui-form-label" style="width:150px;">
                            <span class="x-red">*</span>平台收款码
                        </label>
                        <div class="layui-input-inline">
                            <div class="layui-upload">
                                <button type="button" class="layui-btn" id="test2">上传图片</button>
                                <input type="hidden" name="Aimg" id="Aimg" value="{$Aimg}">
                                <div class="layui-upload-list">
                                    <img class="layui-upload-img" src="{$Aimg}" id="demo2" width="200">
                                    <p id="demoTexts"></p>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label for="username" class="layui-form-label" style="width:150px;">
                            <span class="x-red">*</span>首页底部广告
                        </label>
                        <div class="layui-input-inline">
                            <div class="layui-upload">
                                <button type="button" class="layui-btn" id="test3">上传广告</button>
                                <input type="hidden" name="Gwei" id="Gwei" value="{$Gwei}">
                                <div class="layui-upload-list">
                                    <img class="layui-upload-img" src="{$Gwei}" id="demo3" width="200">
                                    <p id="demoTexts3"></p>
                                </div>
                            </div>
                        </div>
                    </div>
                    <input type="hidden" name="type" value="3">
                    <div class="layui-form-item">
                        <button class="layui-btn" lay-submit="" lay-filter="*" onclick="sub('3')">
                            保存
                        </button>
                    </div>
                </form>
                <div style="height:100px;"></div>
            </div>
        </div>
    </div>
    <script>
        layui.use('upload', function() {
            var $ = layui.jquery
                , upload = layui.upload;

            var url = '{:url("Config/upload")}';
            //普通图片上传
            var uploadInst = upload.render({
                elem: '#test1'
                , url: url
                , before: function (obj) {
                    //预读本地文件示例，不支持ie8
                    obj.preview(function (index, file, result) {
                        $('#demo1').attr('src', result); //图片链接（base64）
                    });
                }
                , done: function (res) {
                    //如果上传失败
                    if(res.code < 0){
                        return layer.msg(res.msg);
                    }else{
                        //上传成功
                        layer.msg(res.msg);
                        $("[name=headImg]").val(res.src);
                    }
                }
                , error: function () {
                    //演示失败状态，并实现重传
                    var demoText = $('#demoText');
                    demoText.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-xs demo-reload">重试</a>');
                    demoText.find('.demo-reload').on('click', function () {
                        uploadInst.upload();
                    });
                }
            });
        });
        layui.use('upload', function() {
            var $ = layui.jquery
                , upload = layui.upload;

            var url = '{:url("Config/uploads")}';
            //普通图片上传
            var uploadInst = upload.render({
                elem: '#test2'
                , url: url
                , before: function (obj) {
                    //预读本地文件示例，不支持ie8
                    obj.preview(function (index, file, result) {
                        $('#demo2').attr('src', result); //图片链接（base64）
                    });
                }
                , done: function (res) {
                    //如果上传失败
                    if(res.code < 0){
                        return layer.msg(res.msg);
                    }else{
                        //上传成功
                        layer.msg(res.msg);
                        $("[name=Aimg]").val(res.src);
                    }
                }
                , error: function () {
                    //演示失败状态，并实现重传
                    var demoTexts = $('#demoTexts');
                    demoTexts.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-xs demo-reload">重试</a>');
                    demoTexts.find('.demo-reload').on('click', function () {
                        uploadInst.upload();
                    });
                }
            });
        });
        layui.use('upload', function() {
            var $ = layui.jquery
                , upload = layui.upload;

            var url = '{:url("Config/uploads")}';
            //普通图片上传
            var uploadInst = upload.render({
                elem: '#test3'
                , url: url
                , before: function (obj) {
                    //预读本地文件示例，不支持ie8
                    obj.preview(function (index, file, result) {
                        $('#demo3').attr('src', result); //图片链接（base64）
                    });
                }
                , done: function (res) {
                    //如果上传失败
                    if(res.code < 0){
                        return layer.msg(res.msg);
                    }else{
                        //上传成功
                        layer.msg(res.msg);
                        $("[name=Gwei]").val(res.src);
                    }
                }
                , error: function () {
                    //演示失败状态，并实现重传
                    var demoTexts = $('#demoTexts3');
                    demoTexts.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-xs demo-reload">重试</a>');
                    demoTexts.find('.demo-reload').on('click', function () {
                        uploadInst.upload();
                    });
                }
            });
        });
        //网站设置
        function sub(type) {
            if(type == 1){
                var fom = $("#myform1").serialize();
            }
            if (type == 2){
                var fom = $("#myform2").serialize();
            }
            if (type == 3){
                var fom = $("#myform3").serialize();
            }
            if (type == 4){
                var fom = $("#myform4").serialize();
            }
            $.ajax({
                type: 'POST',
                url: '{:url("Config/index")}',
                data: fom,
                success: function (data) {
                    if(data.code>0){
                        layer.msg(data.msg,{icon:1,time:1000});
                        setTimeout(function () {
                            location.reload();
                        }, 1000);
                    }else{
                        layer.msg(data.msg,{icon:5,time:1000});
                    }
                },
                error: function (data) {
                    console.log(data.msg);
                },
            });
        }
    </script>
    <script>
        var _hmt = _hmt || [];
        (function() {
            var hm = document.createElement("script");
            hm.src = "https://hm.baidu.com/hm.js?b393d153aeb26b46e9431fabaf0f6190";
            var s = document.getElementsByTagName("script")[0];
            s.parentNode.insertBefore(hm, s);
        })();
    </script>
</body>
</html>